<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //   var teacher = {
      //     name: "小雪",
      //     age: 18,
      //   };
      //   teacher.name = "大雪";
      //   console.log(teacher.name);
      //   console.log(teacher["name"]);

      var obj = {
        name: "可可",
        "type-dog": "阿拉斯加犬",
        color: "rufous",
        age: 5,
        bark: function () {
          console.log("汪汪汪");
        },
      };

      //   console.log(obj.bark);
      //   console.log(obj.bark());

      //   for (var i in obj) {
      //     console.log(i, obj[i]);
      //   }

      /* 
        键值对的方式设置  键 key ：值 value
            增加：
                对象.key  = "value"
                对象[key] = "value"
            删除：
             delete    对象.key
             delete    对象[key]

             查：
                 对象.key  
                 对象[key] 
            
      */
    </script>
  </body>
</html>
